import {tabList} from '../utils/auth'
Component({
  data: {
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#3cc51f",
    list: []
  },
  attached() {
    const token = wx.getStorageSync('my_token')

    if(token) {
      this.setData({
        
        list: tabList.tabbarList
      })
    } else {
      this.setData({
        list: tabList.logoutList
      })
    }
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})
      // this.setData({
      //   selected: data.index
      // })
    }
  }
})